<?php

require '../conn.php';

require 'config.php';

require '../inc/function.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="../css/admin.css" type="text/css" />

<script type="text/javascript" src="inc/function.js"></script>

</head>

<body>

<?php

switch($act){

case 'delete':

	mysql_query('delete from cn_search where id='.$id);

	Msg('','Referer');

	break;

case 'deletes':

	DeleteDatas('delete from cn_search where id');

	break;

}

?>

<div id="container">

	<div class="view">

		<h1>书刊索阅<a href="javascript:location.reload();">刷新</a></h1>

		<form name="form1" id="form1" method="post" action="?act=deletes<?php echo "&page=$page" ?>">

	    <table width="100%" border="0" cellpadding="0" cellspacing="0">

        	<tr class="v_title">

            	<td width="5%">ID号</td>

				<td width="12%">称呼/公司</td>

				<td width="12%">联系电话</td>

				<td width="13%">电子邮箱</td>
				<td width="14%">地址</td>
				<td width="17%">留言内容</td>

                <td width="15%">留言时间</td>

				<td width="12%">操作</td>

        	</tr>

			<?php

			$str='';

			$page_size=15;

			$page_sql='select * from '.$language.'_search order by id desc';

			$page_count=GetPageCount($page_size,$page_sql);

			if ($page>$page_count) $page=$page_count;

			$page_number=($page-1)*$page_size;

			$query=mysql_query($page_sql." limit $page_number,$page_size");

			if (mysql_num_rows($query)>0){	

			while($row=mysql_fetch_array($query)){

				$str.='<tr onmouseover="this.className=\'view_trover\';" onmouseout="this.className=\'view_trout\';">';

				$str.='<td><input type="checkbox" name="checkbox[]" value="'.$row['id'].'" align="absmiddle" />&nbsp;'.$row['id'].'</td>';

				$str.='<td>'.$row['chenghu'].'</td>';

				$str.='<td>'.$row['lianxi'].'</td>';

				$str.='<td>'.$row['email'].'</td>';
				$str.='<td>'.$row['qita'].'</td>';
				$str.='<td>'.$row['neirong'].'</td>';

				$str.='<td>'.$row['shijian'].'</td>';

				$str.='<td><a href="?act=delete&id='.$row['id'].'" onclick="return ConfirmDel();">删除</a></td>';

				$str.='</tr>';

			}

			}

			else {

				$page_show=false;

			}

			echo $str;

			?>

		</table>

		</form>

		<?php if($page_show) echo ShowPage($page,$page_size,$page_sql); ?>

	</div>

</div>

</body>

</html>